package com.server.Thread;

import java.nio.channels.AsynchronousSocketChannel;

import com.model.SendMessage;
import com.server.Thread.Method.Methods;

public class ManageThread extends Thread {

	private SendMessage message;//接收的信息
	private AsynchronousSocketChannel channel;//此客户端的连接
	public ManageThread(AsynchronousSocketChannel sc,SendMessage sm)
	{
		channel=sc;
		message=sm;
	}
	public void run()
	{
		if(message==null)
			return ;
		switch (message.getProtocal())
		{
		case logininfo:Methods.LoginCheck(channel,message.getObject());
			break;
		case ok: Methods.OkMessage(channel);
			break;
		case alterpassword:Methods.alterpassword(channel,message.getObject());
			break;
		case getProblems:Methods.getProblems(channel,message.getObject());
            break;
		case getProblemPaperInfo: Methods.getProblemsInfo(channel,message.getObject());
            break;
		case newScore:Methods.getNewScore(message.getObject());
            break;
		case querystudenscore:Methods.getScore(channel,message.getObject());
            break;
		case newQuestion: Methods.getNewQuestion(message.getObject());
            break;
		case queryteacher:Methods.TeacherGetScore(channel, message.getObject());
            break;
		default:
			break;
		
		}
	}
}